# 组件类

class DVDPlayer:
    def on(self):
        print("DVD Player is on.")

    def play(self, movie):
        print(f"Playing {movie}.")

    def off(self):
        print("DVD Player is off.")


class SoundSystem:
    def on(self):
        print("Sound System is on.")

    def set_volume(self, level):
        print(f"Setting sound volume to {level}.")

    def off(self):
        print("Sound System is off.")


class Projector:
    def on(self):
        print("Projector is on.")

    def set_resolution(self, resolution):
        print(f"Setting projector resolution to {resolution}.")

    def off(self):
        print("Projector is off.")


# 外观类

class HomeTheaterFacade:
    def __init__(self, dvd_player, sound_system, projector):
        self.dvd_player = dvd_player
        self.sound_system = sound_system
        self.projector = projector

    def watch_movie(self, movie):
        print("Get ready to watch a movie...")
        self.projector.on()
        self.projector.set_resolution("1080p")
        self.sound_system.on()
        self.sound_system.set_volume(10)
        self.dvd_player.on()
        self.dvd_player.play(movie)

    def end_movie(self):
        print("Shutting down the home theater...")
        self.dvd_player.off()
        self.sound_system.off()
        self.projector.off()


# 客户端代码

dvd_player = DVDPlayer()
sound_system = SoundSystem()
projector = Projector()

home_theater = HomeTheaterFacade(dvd_player, sound_system, projector)
home_theater.watch_movie("Inception")
home_theater.end_movie()
